/** @jsxRuntime automatic */
/** @jsxImportSource ../xml-runtime */
import { ClipItem } from './ClipItem'

function Mono({ pathObject, data, idPrefix, renderLinks }) {
  return (
    <track>
      {data.map((item, index) => (
        <ClipItem.Mono
          key={index}
          index={index}
          idPrefix={idPrefix}
          pathObject={pathObject}
          startFrame={item.start}
          endFrame={item.end}
          totalStart={item.totalStart}
          totalEnd={item.totalEnd}
          renderLinks={renderLinks}
        ></ClipItem.Mono>
      ))}
    </track>
  )
}

function Stereo({
  data,
  pathObject,
  idPrefix,
  explodedTrackIndex,
  trackIndex,
  trackCount,
  renderLinks,
}) {
  return (
    <track
      currentExplodedTrackIndex={explodedTrackIndex}
      totalExplodedTrackCount={trackCount}
      premiereTrackType="Stereo"
    >
      {data.map((item, index) => (
        <ClipItem.Stereo
          key={index}
          index={index}
          idPrefix={idPrefix}
          pathObject={pathObject}
          startFrame={item.start}
          endFrame={item.end}
          totalStart={item.totalStart}
          totalEnd={item.totalEnd}
          trackIndex={trackIndex}
          renderLinks={renderLinks}
        ></ClipItem.Stereo>
      ))}
    </track>
  )
}

export const Track = { Mono, Stereo }
